package com.tengju.motivation.domain.shared;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * 工具类：年
 *
 * @author 大木
 * @date 2021/12/02
 */
@Getter
public class Year {

    private LocalDate yearStartDate;
    private LocalDate yearEndDate;

    public Year(String year) {
        if (StringUtils.isBlank(year)) {
            return;
        }
        this.yearStartDate = LocalDate.parse(year + "01" + "01", DateTimeFormatter.ofPattern(DateUtil.DATE_FORMAT));
        this.yearEndDate = LocalDate.parse(year + "12" + "31", DateTimeFormatter.ofPattern(DateUtil.DATE_FORMAT));
    }


}
